<?php
/**
 * Created by PhpStorm.
 * User: XYX
 * Date: 2017/8/29
 * Time: 16:36
 */

namespace App\Api\Controllers;


use App\Api\Transformers\TrainInforTransformer;
use App\Api\Transformers\TwitterInfoTransformer;
use App\Api\Transformers\TwitterTransformer;
use App\Train;
use App\Twitter;

class TrainController extends BaseController
{
    /**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        //
        $train = Train::all();
        return $this->response->collection($train,new TwitterTransformer());
    }
    /**
     * Display the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function show($id)
    {
        //
        $train = Train::find($id);
        return $this->response->item($train,new TrainInforTransformer());
    }
}